[SUBJECT]
Description=Show the user's favorite links
ImageIndex=-1
Folder=DHTML Tools


[BODY_TEXT]
;
;<script language="JavaScript"><!--
;var cookiename = '`cookie_name`';
;var urltable= new Array();
;var urlvar= new Array();
;
;function editlinks(name,scrwidth,scrheight){ startDate= new Date(); tWin = window.open(name,
;startDate.getTime(),
;"toolbar=no,location=no,resizable=no,status=no,scrollbars=yes,menubar=no,width="+ scrwidth + "height=" + scrheight);
;}
;
;
;function link(url,text)
;{
;	this.url=url;
;	this.text=text;
;}
;
;function getcookie (cookiename) {
;  var cname = cookiename + "=";
;  var i = 0;
;  while (i < document.cookie.length) {
;    var j = i + cname.length;
;    if (document.cookie.substring(i, j) == cname){
;    var leng = document.cookie.indexOf (";", j);
;    if (leng == -1) leng = document.cookie.length;
;    return unescape(document.cookie.substring(j, leng));
;    }
;    i = document.cookie.indexOf(" ", i) + 1;
;    if (i == 0) break;
;  }
;  return "*";
;}
;
;
;function getlinks()
;{
;    vcookie = getcookie(cookiename);
;    if (vcookie=="*")
;    {
;       return false
;    }
;    else
;    {
;       urlvar = vcookie.split("##");
;       for (i=0; i < urlvar.length; i++)
;       {
;            text = urlvar[i].split("%%");
;            urltable[i]= new link(text[0], text[1]);
;       }
;       return true;
;    }
;}
;// --></script>
;
;
;<SCRIPT LANGUAGE="JavaScript">
;<!--
;if (top.location != location) top.location.href = location.href;
;// -->
;</SCRIPT>
;
;
;<center>
;<strong>`title`</strong>
;<BR>
;<script language="JavaScript"><!--
;			getlinks();
;			for (i=0; i < urltable.length ; i++){
;			document.writeln('<a href="http://' + urltable[i].url + '" target="_blank">' + urltable[i].text + '</a><BR>');}
;// --></script>
;<br>
;
;<form NAME="Edit" METHOD="Post">
;<input TYPE="button" VALUE="`edit_caption`"  onClick="editlinks('EditMyLinks.html',600,600)">
;</form>
;</center></div>
;
;<br>
;</center>
;



[`cookie_name`]
Kind=S
Value=myfavoritelinks
Group=1


[`title`]
Kind=S
Value=MY FAVORITE LINKS


[`edit_caption`]
Kind=S
Value=Edit links



[ADD_FILE]
Name=EditMyLinks.html
;<html>
;<head>
;<title>Add/Remove My Links</title>
;<script LANGUAGE="JavaScript"><!--
;var cookiename = '`cookie_name2`';
;var urltable = new Array();
;var maxcount = 10;
;var urlvar= new Array();
;
;
;function CloseWindow()
;{
;  window.close();
;  return true;
;}
;
;
;function link(url,text)
;{
;	this.url=url;
;	this.text=text;
;}
;
;function setcookie (cookiename, cookievar) {
;
;  var expire = new Date ();
;  document.cookie = cookiename + "= " + escape (cookievar) +
;	"; expires=Mon, 10-Jan-2009 00:00:01 GMT; path=/;"
;}
;
;
;function getcookie (cookiename) {
;  var cname = cookiename + "=";
;  var i = 0;
;  while (i < document.cookie.length) {
;    var j = i + cname.length;
;    if (document.cookie.substring(i, j) == cname){
;    var leng = document.cookie.indexOf (";", j);
;    if (leng == -1) leng = document.cookie.length;
;    return unescape(document.cookie.substring(j, leng));
;    }
;    i = document.cookie.indexOf(" ", i) + 1;
;    if (i == 0) break;
;  }
;  return "*";
;}
;
;
;
;
;function setlinks()
;{
;
;    urlvar = new Array();
;    if (urltable.length > 0)
;    {
;        for (i=0; i < urltable.length; i++)
;        {
;            urlvar[i]=urltable[i].url + "%%" + urltable[i].text;
;
;        }
;        var cookievar = urlvar.join("##");
;        setcookie(cookiename,cookievar);
;    }
;    else
;    {
;        deletecookie(cookiename);
;    }
;    return true;
;}
;
;
;
;function getlinks()
;{
;    cookievar = getcookie(cookiename);
;    if (cookievar=="*")
;    {
;       return false
;    }
;    else
;    {
;       urlvar = cookievar.split("##");
;       for (i=0; i < urlvar.length; i++)
;       {
;            text = urlvar[i].split("%%");
;            urltable[i]= new link(text[0], text[1]);
;       }
;       return true;
;    }
;}
;
;
;function addlink(lurl,ltext)
;{
;    var i = urltable.length;
;    if (i >= maxcount)
;    {
;        alert ("You can add maximum " + maxcount+ " links");
;    }
;    else
;    {
;       urltable[i] = new link(lurl,ltext);
;       setlinks();
;       window.location.reload();
;    }
;    return true;
;}
;
;
;function deleteurl(urlc)
;{
;
;    var no = parseInt(urlc.substring(3,urlc.length),10);
;
;    for (i=no; i < urltable.length; i++)
;    {
;        if (i == (urltable.length - 1))
;            {
;                urltable[i] = "";
;                urltable.length -= 1;
;            }
;            else
;        {
;                urltable[i] = urltable[i+1];
;        }
;    }
;    setlinks();
;    window.location.reload();
;    return true;
;}
;
;function deletecookie()
;{
;   	document.cookie = cookiename +"=; expires=Thu, 10-Jan-88 00:00:02 GMT";
;   	document.cookie = cookiename +"=; expires=Thu, 10-Jan-88 00:00:02 GMT; path=/";
;	window.location.reload();
;	return true;
;}
;// --></script>
;</head>
;
;<body BGCOLOR="#000000" text="#FFFFFF" link="#FF0000" alink="#00FF00" vlink="#0000FF">
;
;
;<center>
;<u>Add / Remove Your Favorite Links</u>
;
;<form NAME="New" METHOD="Post">
;      http://&nbsp;<input TYPE="text" NAME="URL" size="20" MAXLENGHT="80">&nbsp;<input TYPE="text" NAME="TXT" size="20" MAXLENGHT="30">&nbsp;
;      <input TYPE="button" VALUE="Add"  onClick="addlink(New.URL.value,New.TXT.value)">
;</form>
;
;
;<br>
;<br>
;<br>
;<br>
;
;
;
;<form METHOD="Post" NAME="Form">
;<script LANGUAGE="JavaScript"><!--
;getlinks();
;if (urltable.length > 0)
;{
;  document.write('<table border="3" cellpadding="5" cellspacing="0">');
;  document.write('<caption><strong>Available links</strong></caption>');
;  document.write('<tr><th>URL</th><th>Description</th><th>&nbsp</th></tr>');
;
;  for (i=0; i < urltable.length ; i++)
;  {
;	document.writeln('<tr>');
;	document.writeln('<td>');
;	document.writeln('http://&nbsp;<input type=text name= "url' + i + '" value="' + urltable[i].url + '" size=20 maxlength=80> </td><td>');
;	document.writeln('<input type=text name= "txt' + i + '" value="' + urltable[i].text + '" size=20 maxlength=30> </td><td>');
;	document.writeln('<input type=button name= "del' + i + '" value="Delete" onClick="deleteurl(this.name)">&nbsp;</td>\n');
;	document.writeln('</tr>\n');
;   }
;   document.writeln('</table>');
;}
;else
;{
;   document.write('<strong>There are not available links yet!</strong>');
;}
;// --></script>
;
;</form>
;
;<br>
;<br>
;
;
;
;
;<form NAME="Ok" METHOD="Post">
;  <center>
;     <input TYPE="button" VALUE="    Ok    " onClick="CloseWindow()">
;  </center>
;</form>
;<br>
;
;</body>
;</html>



[`cookie_name2`]
Kind=S
Value=myfavoritelinks
Visible=0
Group=1

